<template>
	<view>
		
		<view v-for="(item,index) in data" :key="index" style="width: 100%;">
			<view style="background: #fff;margin-bottom: 20upx;">
				<view class="goods">
					<view class="top webkit">
						<view class="flex">订单号：{{item.order_sn}}</view>
						<text v-if="item.status == 0">拼团中</text>
						<text v-if="item.status == 5">拼团成功</text>
						<text v-if="item.status == 10">核销完毕</text>
					</view>
						
					<view class="center webkit">
						<image :src="item.thumb" mode=""></image>
						<view class="flex ellipsis-2" style="height: 96upx;line-height: 48upx;">{{item.goodsname}}</view>
						<view>
							<text>￥{{item.total_fee}}</text>
							<text style="color: #999;">x{{1}}</text>
						</view>
					</view>
						
					<view class="bottom">
						共{{1}}件商品 实付: <text style="padding-left: 8upx;"> {{item.total_fee}}元</text>
					<view class="bottom">
						本次获得佣金 <text style="padding-left: 8upx;"> {{item.fenxiao}}元</text>
					</view>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:[],
				openid:'',
			};
		},
		onLoad:function(){
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			});
		},
		methods:{
			setAjax(){
				uni.request({
					url: 'https://www.xiaonengxinxi.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=member.fenxiang.order&app=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						this.data = res.data.order
						uni.hideLoading()
					},
					fail: () => {},
					complete: () => {}
				});
			},
		}
	}
</script>

<style>
	.webkit{
		display: -webkit-box;
	    display: -webkit-flex;
	    display: -ms-flexbox;
	    display: flex;
	}
	.flex{
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		-ms-flex: 1;
		flex: 1;
	}
	.goods{
		padding-bottom: 10upx;
		border-bottom: 1px solid #f0f0f0;
	}
	.goods .top{
		padding: 16upx 20upx;
		border-bottom: 1px solid #f0f0f0;
		margin-bottom: 10upx;
	}
	.goods .top .flex{
		font-size: 26upx;}
	.goods .top text{
		color: #666;
		font-size: 26upx;
	}
	.goods .center{
		    padding: 16upx 30upx;
	}
	.goods .center image{
		width: 160upx;
		height: 160upx;
		margin-right: 20upx;
	}
	.goods .center view{}
	.goods .center .flex{
		margin-right: 20upx;
	}
	.goods .center text{
		display: block;
		text-align: right;
		font-size: 26upx;
	}
	.goods .bottom{
		font-size: 24upx;
		text-align: right;
		padding: 10upx 30upx;
	}
	.goods .bottom text{
		font-size: 26upx;
		color: #f55;
	}
	.status{
		padding: 20upx;
	}
	.status button{
		height: 56upx;
		font-size: 24upx;
		line-height: 56upx;
		margin: 0;
		margin-left: 20upx;
		border-radius: 56upx;
	}
	.status button:after{
		display: none;
	}
	
	.act {
		position: absolute;
		top: 35upx;
		right: 30upx;
		color: #b71c24;
	}
	.uni-list image {width:34upx;height:34upx;}
	.uni-list .text {position:absolute;left:84upx;font-size:26upx;}
	.uni-list {margin-top:20upx;}
	.uni-list:before,.uni-list:after {display:none;}
	.uni-list-cell:after {content:" ";position:absolute;left:0.5rem;right:0.5rem;bottom:-1px;height:1px;border-top:1px solid #ebebeb;color:#D9D9D9;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(0.5);-ms-transform:scaleY(0.5);transform:scaleY(0.5);background:none;}
	.uni-list-cell .right {font-size:24upx;color:#999;margin-right:20upx;}
	.uni-list .uni-list-cell:last-child:after {border:0;}
	.uni-list .uni-badge {margin-right:15px;background-color:#f55;}
</style>
